- /* sfostrm.cpp by K.Tsuru */
- // function ID = 7004
- /**************************
- SComplex class
- It provides the output.
- **************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
- // static objects of SFFormat class
- int SFFormat::sfLineFormat = SFFormat::BRACKET; // set by BRACKET | END_CR | MID_CR
- void SFFormat::SetSFFormat(int fmt, long fig) {
- sfLineFormat = fmt; figUnit = fig;
- }
- // output stream SFraction class.7004
- ostream& operator<<(ostream& os, SFraction& sf) { // "sf" is not const
- SLong tmp;
- long p = 0;
-
- if(sf.sfLineFormat & sf.BRACKET) { os << '('; p++; }
- os << sf.Num(); p += tmp.ioCount;
- os << '/'; p++;
- if(sf.sfLineFormat & sf.MID_CR) { os << endl; p++; }
-
- tmp.ioCount = 0;
- os << sf.Den(); p += tmp.ioCount;
- if(sf.sfLineFormat & sf.BRACKET) { os << ')'; p++; }
- if(sf.sfLineFormat & sf.END_CR) { os << endl; p++; }
- sf.ioCount = p;
- return os;
- }
sfostrm.cpp : last modifiled at 2016/04/20 14:25:55(913 bytes)
created at 2015/12/22 16:07:29
The creation time of this html file is 2016/09/17 15:33:55 (Sat Sep 17 15:33:55 2016).